<form class="edit_sprint">
  <div id="form-errors"></div>

  <label for="start-on">Sprint start date</label>
  <div class='label-hint'>
    (click to show the calendar)
  </div>
  <div class='input-row'>
    <input id="start-on" name="start_on" type="text" autocomplete="off">
  </div>

  <div class='label-spacer'></div>

  <label for="duration-days">Duration of sprint in days</label>
  <div class='label-hint'>
    (typically working days)
  </div>
  <div class='input-row'>
    <input id="duration-days" name="duration_days" type="text" value="<%=model.get('duration_days')%>" class="narrow" autocomplete="off">
  </div>

  <div class='label-spacer'></div>

  <% if (backlog.get('velocity')) { %>
    <div class='input-row question'>
      <label>How would you like the team velocity for this sprint to be determined?</label>
    </div>

    <div class='input-row'>
      <input type="radio" id="use-team-members" name="calculation_method">
      <label for="use-team-members" id="use-explicit-velocity-false">Use backlog velocity of <%= niceNum(backlog.get('velocity')) %> points per person per day</label>
    </div>

    <div id="use-team-members-container">
      <label for="number-team-members" class="light">Number of team members</label>
      <div class='label-hint'>
        (working on this sprint completing stories)
      </div>
      <div class='input-row'>
        <input id="number-team-members" name="number_team_members" type="text" value="<%=niceNum(model.get('number_team_members'))%>" class="narrow" autocomplete="off">
      </div>
      <div class='input-row'>
        Expected team velocity: <span id="expected-velocity">(unknown)</span>
      </div>
    </div>

    <div class='input-row'>
      <input type="radio" id="use-explicit-velocity" name="calculation_method">
      <label for="use-explicit-velocity" id="use-explicit-velocity-true">Manually define a team velocity for this sprint</label>
    </div>

    <div id="use-explicit-velocity-container">
      <label for="explicit-velocity" class="light">Velocity in points</label>
  <% } else { %>
    <div class="input=row">
      <label for="explicit-velocity">Team velocity for this sprint</label>
      <div class='label-hint'>
        (in points)
      </div>
    </div>
  <% } %>
      <div class='input-row'>
        <input id="explicit-velocity" name="explicit_velocity" type="text" value="<%=niceNum(model.get('explicit_velocity'))%>" class="narrow" autocomplete="off">
      </div>
  <% if (backlog.get('velocity')) { %>
    </div>
  <% } %>

  <div class='label-spacer'></div>

  <label>Sprint Status: This sprint is...</label>
  <div class="form-box">
    <div class="input-row">
      <input type="radio" name="sprint_status" id="sprint_status_completed"<%=model.IsComplete() ? ' checked="checked"' : ''%>>
      <label for="sprint_status_completed">Complete <span class="detail">— All stories are complete</span></label>
    </div>
    <div class="input-row">
      <input type="radio" name="sprint_status" id="sprint_status_incomplete"<%=!model.IsComplete() ? ' checked="checked"' : ''%>>
      <label for="sprint_status_incomplete">Incomplete <span class="detail">— currently a work in progress or being used for planning the next iteration</span></label>
    </div>
  </div>

  <div class='label-spacer'></div>

  <% if (backlog.CanEdit()) { %>
    <a id="sprint_submit" class="button" href="#update">Update sprint settings</a>
    <a id="sprint_cancel" href="#cancel" data-message="discard changes">← Back</a>
  <% } else { %>
    <a id="sprint_cancel" href="#cancel" class="button">← Back to backlog</a>
  <% } %>
</form>